package com.wbcs.system.component.container.panel;

import com.wbcs.config.component.IComponentConfigBean;
import com.wbcs.config.component.container.AbsContainerConfigBean;
import com.wbcs.config.component.container.panel.VerticalPanelBean;
import com.wbcs.system.ReportRequest;
import com.wbcs.system.component.IComponentType;
import com.wbcs.system.component.container.AbsContainerType;
import com.wbcs.system.tags.component.AbsComponentTag;
import com.wbcs.util.Consts;

public class VerticalPanel extends AbsPanelType
{
    public VerticalPanel(AbsContainerType parentContainerType,IComponentConfigBean comCfgBean,ReportRequest rrequest)
    {
        super(parentContainerType,comCfgBean,rrequest);
    }

    public void displayOnPage(AbsComponentTag displayTag)
    {
        if(!rrequest.checkPermission(this.containerConfigBean.getId(),null,null,Consts.PERMISSION_TYPE_DISPLAY))
        {
            wresponse.println("&nbsp;");
            return;
        }
        wresponse.println(showContainerStartPart());
        wresponse.println(showContainerTableTag());
        if(rrequest.checkPermission(this.containerConfigBean.getId(),Consts.DATA_PART,null,Consts.PERMISSION_TYPE_DISPLAY))
        {
            IComponentType childObjTmp;
            for(String childIdTmp:lstChildrenIds)
            {
                wresponse.println("<tr>");
                childObjTmp=this.mChildren.get(childIdTmp);
                showChildObj(childObjTmp,null);
                wresponse.println("</tr>");
            }
        }
        wresponse.println("</table>");
        wresponse.println(showContainerEndPart());
    }

    @Override
	protected AbsContainerConfigBean createContainerConfigBean(AbsContainerConfigBean parentContainer,String tagname)
    {
        return new VerticalPanelBean(parentContainer,tagname);
    }
    
    @Override
	protected String getComponentTypeName()
    {
        return "container.vpanel";
    }
}
